package com.ojoin.trade.supplyloan_core.web.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.utils.TimeUtils;
import com.ojoin.trade.common.web.dao.BaseDao;
import com.ojoin.trade.common.web.service.impl.BaseServiceImpl;
import com.ojoin.trade.supplyloan_core.web.dao.TbSlSupplyinfoCheckDao;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlPlatformUser;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlSupplyinfoCheck;
import com.ojoin.trade.supplyloan_core.web.service.TbSlSupplyinfoCheckService;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 15-10-27
 * Time: 下午2:53
 * To change this template use File | Settings | File Templates.
 */
@Service
public class TbSlSupplyinfoCheckServiceImpl extends BaseServiceImpl<TbSlSupplyinfoCheck> implements TbSlSupplyinfoCheckService {
   @Autowired
   private TbSlSupplyinfoCheckDao dao;

    @Override
    protected BaseDao<TbSlSupplyinfoCheck> getBaseDao() {
        return dao;
    }

//    @Override
//    public void addTbSlSupplyinfoCheck(int idOfTbMerchantUser, String platformName, int idOfPlatformUser, String mhtName, String supplyName, String memo, int checkStatus) throws BusinessException {
//        TbSlSupplyinfoCheck supplyinfoCheckvo=new TbSlSupplyinfoCheck();
//        supplyinfoCheckvo.setIdOfPlatformUser(idOfPlatformUser);
//        supplyinfoCheckvo.setIdOfTbMerchantUser(idOfTbMerchantUser);
//        supplyinfoCheckvo.setPlatformName(platformName);
//        supplyinfoCheckvo.setMemo(memo);
//        supplyinfoCheckvo.setCheckStatus(checkStatus);
//        supplyinfoCheckvo.setMhtName(mhtName);
//        supplyinfoCheckvo.setSupplyName(supplyName);
//        supplyinfoCheckvo.setCheckDate(CommonUtils.getCurDate());
//        ((TbSlSupplyinfoCheckDao)this.getBaseDao()).insertTbSlSupplyInfoCheck(supplyinfoCheckvo);
//    }

    @Override
    public void insertTbSlSupplyinfoCheck(TbSlSupplyinfoCheck checkvo) throws BusinessException {
        ((TbSlSupplyinfoCheckDao)this.getBaseDao()).insertTbSlSupplyInfoCheck(checkvo);
    }

    @Override
    public TbSlSupplyinfoCheck queryTbSlSupplyinfoCheckByJoinid(int joinid) throws BusinessException {

        return  ((TbSlSupplyinfoCheckDao)this.getBaseDao()).queryTbSlSupplyinfoCheckByJoinidandDate(joinid,TimeUtils.getCurDate()) ;
    }
    
    @Override
	public TbSlSupplyinfoCheck getInfoCheckVOByPlatformUser(TbSlPlatformUser platformUser) {
		TbSlSupplyinfoCheck checkvo = new TbSlSupplyinfoCheck();
		checkvo.setIdOfPlatformUser(platformUser.getId());
		checkvo.setIdOfTbMerchantUser(platformUser.getIdOfTbMerchantUser());
		checkvo.setPlatformName(platformUser.getPlatformName());
		checkvo.setCheckDate(TimeUtils.getCurDate());
		
		return checkvo;
	} 
    
    
}
